<template>
  <div class="recruitmentManagement">
    <van-nav-bar
      title="招聘员工黑名单"
      left-arrow
      @click-left="$router.push('/mine')"
    >
      <template #right>
        <van-icon style="margin-right: 20px;" name="search" size="20" @click="goNeedPage_recruitStaff('search')"/>
        <van-icon
          name="ellipsis"
          size="18"
          @click="showOverlay = true"
        />
      </template>
    </van-nav-bar>

    <van-overlay
      :show="showOverlay"
      @click="showOverlay = false"
      class-name="over_layer"
    >
      <van-cell-group class="layer">
        <van-cell @click="goWorkInfo(item)"  v-for="(item, index) in navList" :key="index" :value="item.text" :icon="item.icon"/>
      </van-cell-group>
    </van-overlay>


    <com-filter-menu
      :rightOptionObj="rightOptionObj" :rightOption="rightOption"
      :rightValue="rightValue" @getFilterMenuValue="toGetFilterMenuValue_recruitStaff"
    ></com-filter-menu>

    <com-multiple-checkbox-card
      :dataList="recruitStaffList"
      :keyWord="'staffList'"
      :blackType='1'
    ></com-multiple-checkbox-card>






    <!--<nut-drag direction="y" :style="{right:'0px', top:'66%'}" class="quick_links">
      <nut-fixednav
        :nav-list="navList" @selected="selected" class="quick_links_detail"
        active-text="收起" un-active-text="导航"
      ></nut-fixednav>
    </nut-drag>-->

    <!-- 底部栏 -->
    <com-my-company-tar-bar></com-my-company-tar-bar>


  </div>
</template>

<script>
  import comMyCompanyTarBar from '../../../components/comMyCompanyTarbar';
  import comFilterMenu from '../../../components/comFilterMenu';
  import comJobItem from '../../../components/comJobItem';
  import {obj} from '../../../constants/comUtils';
  import comMultipleCheckboxCard from '../companyHome/common/comMultipleCheckboxCard';
  import { GoWorkInfo } from '../../../utils/recruitToUrl'

  import quickMenu from './common/quickMenu';
  import lend from '@/assets/img/myCompany/lend.png';
  import more from '@/assets/img/myCompany/more.png';
  import salary from '@/assets/img/myCompany/salary.png';
  import signUp from '@/assets/img/myCompany/signUp.png';
  import work from '@/assets/img/myCompany/work.png';

  import {reqGetlistsOwner,reqGetApply} from '@/api/myCompany.js'

  const rightOptionObj = {
    'read': '离职',
    'unread': '在职',
    'zili':'自离'
  };
  const rightOption = [
    { text: '全部（不限）', value: 'all' },
    { text: '男', value: 'man' },
    { text: '女', value: 'women' },
    { text: '黑名单', value: 'pickUp_call_no' },
    { text: '白名单', value: 'employerEnterprise_noCall' },
  ];

  export default {
    name: 'blackList',
    components: {
      quickMenu,
      comJobItem,
      comFilterMenu,
      comMultipleCheckboxCard,
      comMyCompanyTarBar
    },

    data(){
      return {
        rightValue: 'unread',
        titleName: '报名未读',
        rightOption,
        rightOptionObj,
        showOverlay: false,
        recruitStaffList:[],
        navList: [
          {
            id: 1,
            text: '报名信息',
            icon: signUp
          },
          {
            id: 2,
            text: '工作信息',
            icon: work
          },

          {
            id: 3,
            text: '借支信息',
            icon: lend
          },
          {
            id: 4,
            text: '工资信息',
            icon: salary
          },
          {
            id: 5,
            text: '招聘员工黑名单',
            icon: more
          }
        ],
        needObj: obj,
        needObjTotal:'',

        /*
        * quickMenu 组件需要，暂时保留
        * */
        icons:["fa fa-github","fa fa-comment","fa fa-code","fa fa-envelope"],
        list: [
          {'isLink': false },
          {'isLink': true, url: "/mime"},
          {'isLink': true, url: "/"},
          {'isLink': false }
        ],
      }
    },
    async created() {
      let id = '68b730110bb645aa8955868c99d71a15'
      const res = await reqGetApply(id)
      console.log(res)
      if (res.code === 200) {
         this.needObj = res.data
         this.recruitStaffList = res.data.applylist
        console.log(res.data.applylist)
      }
    },

    methods: {
      goNeedPage_recruitStaff(val){
        const keyWord = 'recruitStaff';
        if (val === 'search'){
          this.$router.push({
            path: `/searchRecords/${keyWord}`,
          })
        }
      },
      //右上角---跳转页面
      goWorkInfo(data){
        GoWorkInfo(data)
      },
      toGetFilterMenuValue_recruitStaff(val) {
        console.log('传值---读不读', val)

      },
      selected($event) {
        console.log('当前点击', $event.item);
      },

      toGetFilterMenuValue_recruitmentManagement(val){
        console.log('传值---读不读', val);
        this.titleName = this.rightOptionObj[val]
      },
    }
  }
</script>

<style lang="scss" scoped>
  .recruitmentManagement{
    width: 100%;
    .over_layer {
      margin-top: 46px;
      height: 100%;
      .layer {
        width: 42%;
        font-size: 14px;
        position: absolute;
        right: 0;
        z-index: 2;
      }
    }
    /deep/ .quick_links{
      .nut-fixednav.active .fixed-list{
        right: 0;
      }
      .quick_links_detail{
        .fixed-list{
          right: -110%;
          li {
            min-width: 1.56rem;
            img {
              /*display: none;*/
            }
            span{
              /*border: 1px solid blue;*/
            }
          }
        }
      }
    }
  }
</style>
